package com.youli.gb.service.impl;

import java.util.List;

import com.youli.gb.mapper.SysUserMapper;
import com.youli.gb.model.SysUser;
import com.youli.gb.service.ISysUserService;
import com.youli.gb.utils.DBUtils;

public class SysUserServiceImpl implements ISysUserService {

	private SysUserMapper userMapper = DBUtils.getSqlSession().getMapper(SysUserMapper.class);

	@Override
	public SysUser getById(int id) {
		SysUser user = userMapper.getById(id);
		return user;
	}

	@Override
	public List<SysUser> getAll() {
		return userMapper.getAll();
	}

	@Override
	public int add(SysUser sysUser) {		
		return this.userMapper.add(sysUser);
	}

	@Override
	public SysUser getByLoginName(String loginName) {
		return this.userMapper.getByLoginName(loginName);
	}

	@Override
	public int deleteById(Integer id) {
		return this.userMapper.deleteById(id);
	}

	@Override
	public int deleteByIds(String[] ids) {		
		return this.userMapper.deleteByIds(ids);
	}

	@Override
	public SysUser getByEmail(String email) {
		return this.userMapper.getByEmail(email);
	}

	@Override
	public SysUser getByPhone(String phone) {
		return this.userMapper.getByPhone(phone);
	}

	@Override
	public int edit(SysUser sysUser) {
		return this.userMapper.edit(sysUser);
	}

	@Override
	public SysUser login(String account, String password) {
		return this.userMapper.login(account,password);
	}

	@Override
	public int modifyPassword(String password, int userId) {
		return this.userMapper.modifyPassword(password,userId);
	}
}
